def main():
    try:
        module = __import__(raw_input())
        i = 0
        for m in dir(module) : 
            if type(getattr(module, m)) == type(module) :
                i += 1
        
        print i
    except ImportError:
        print -1

main()